<%@ page language="C#" autoeventwireup="true" inherits="Manage_Invoices_SendInvoice, App_Web_sendinvoice.aspx.15b92c9b" %>
<%@ Register Assembly="Huayou.Common" Namespace="Huayou.UI.WebControls" TagPrefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title></title>
	<LINK href="../css.css" type="text/css" rel="stylesheet">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<script language="javascript" src="../../js/jslib.js" type="text/javascript"></script>
				<script language="javascript">				
function sendit(o) {
		var result = getchecknum(o);
		if (result <= 0)  {
			alert('Please select the invoices!');
			return false;
		}
		return confirm("Really send it?");
}

function checkallorno(o) {
	var a = o;

	while (true) {
		var a = a.parentElement;
		if (a == null) {
			break;
		}
		if ( a == "undefined") {
			a = null;
			break;
		}
		if (a.tagName == "TABLE") {
			break;	
		}
	}
	if (a != null) {
		for (i = 0;i < a.rows.length; i++) {
			for (j = 0;j < a.rows[i].cells[0].children.length; j++) {
				var var1 = a.rows[i].cells[0].children[j];
				if (var1.tagName == "INPUT" ) {
					if (var1.type == "checkbox") {
						var1.checked = o.checked;
					}
				}
			}
		}
	}
}

function getchecknum(frm) {
	var result = 0;
	var checkboxnum = 0;
	for (var i = 0; i < frm.length; i++) {
		if (frm.elements[i].type == "checkbox") {
			checkboxnum++;
			//??????,???
			if (checkboxnum > 1) {
			    if (frm.elements[i].checked) {
				    result++;
			    }
			}
		}
	}
	return result;
}
				</script>
</head>
<body topmargin="0" leftmargin="0">
    <form id="form1" runat="server">
<table width="99%"  border="0" cellspacing="0" cellpadding="0" align="center" class="NormalText"> 
  <tr>
    <td style="height: 40px" class="HeadText">Send Invoices</td>
  </tr>
  <tr>
    <td><table width="100%"  border="0" cellspacing="1" cellpadding="1" id="TABLE1" onclick="return TABLE1_onclick()">
      <tr>
        <td width="12%" height="22"> Invoice No:</td>
        <td>
            &nbsp;
            <asp:TextBox ID="txtInvoiceNo" runat="server" Width="160px"></asp:TextBox></td>
        <td width="15%">Client Name: </td>
        <td><asp:TextBox ID="txtOrgName" runat="server" Width="160px"></asp:TextBox></td>
      </tr>
      <tr>
        <td height="22" colspan="4">Invoice Preiod:            
            <asp:TextBox ID="txtFromDate" runat="server" Width="160px" onclick="this.value='';">dd/mm/yyyy</asp:TextBox>
            to
            <asp:TextBox
                ID="txtToDate" runat="server" Width="160px" onclick="this.value='';">dd/mm/yyyy</asp:TextBox>
            &nbsp;
            <asp:Button ID="btnSearch" runat="server" Text="Search" CssClass="submitBtn" OnClick="btnSearch_Click" />
            &nbsp;
            <asp:Button ID="btnSend" runat="server" Text="Send" CssClass="submitBtn" OnClick="btnSend_Click" />
			</td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td height="22">
        <cc1:datagridtable CellPadding=1 CellSpacing=1 BackColor=#cccccc Width=100% id="dgdList" runat="server" BorderWidth="0px" BorderStyle="None" IsAllowPaging="True" PageSize="12" OnDataBinding="dgdList_DataBinding" OnPageIndexChanged="dgdList_PageIndexChanged" AutoGenerateColumns="False" CssClass="tableGrid" MaxRecord="0" PageCSS="scrollButton" AllowPaging="True" OnItemDataBound="dgdList_ItemDataBound">
            <PagerStyle CssClass="gridPager" BackColor="White" />
            <SelectedItemStyle CssClass="gridSelectedItem" />
            <ItemStyle Height="25px" CssClass="gridItem" BackColor="White"></ItemStyle>
			<HeaderStyle Height="22px" CssClass="right-ta-ti01" Font-Bold="True"></HeaderStyle>
            <AlternatingItemStyle CssClass="gridAltItem" />
            <FooterStyle CssClass="gridFooter" BackColor="White" />
            <EditItemStyle CssClass="gridEditItem" />
            <Columns>
														<asp:BoundColumn Visible="False" DataField="sid">
															<HeaderStyle Width="0%"></HeaderStyle>
														</asp:BoundColumn>
														<asp:TemplateColumn HeaderText="??">
															<HeaderStyle Width="1%"></HeaderStyle>
															<HeaderTemplate>
																<INPUT name="checkbox" type="checkbox" id="chkselectall" onclick="checkallorno(this)">
															</HeaderTemplate>
															<ItemTemplate>
																<asp:CheckBox id="chkID" runat="server"></asp:CheckBox>
															</ItemTemplate>
														</asp:TemplateColumn>
                <asp:BoundColumn DataField="Sid" HeaderText="Invoice No"></asp:BoundColumn>
                <asp:BoundColumn DataField="OrgName" HeaderText="Client Name"></asp:BoundColumn>
                <asp:BoundColumn DataField="InvoiceDate" HeaderText="Invoice due"></asp:BoundColumn>
                <asp:BoundColumn DataField="InvoiceAmount" HeaderText="Invoice amount"></asp:BoundColumn>
                <asp:BoundColumn DataField="ReceiveAmount" HeaderText="Amount paid"></asp:BoundColumn>
                <asp:TemplateColumn HeaderText="Detail">
                    <itemtemplate>
<a href="InvoiceDetail.aspx?Guid=<%# Eval("Guid")%>&OrgSid=<%# Eval("OrgSid")%>" target="_blank">Detail</a>
</itemtemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="Delete">
                    <itemtemplate>
<a href="../OrgInfo/InvoiceDel.aspx?Sid=<%# Eval("Sid")%>&OrgSid=<%# Eval("OrgSid")%>&type=4" onclick="return confirm('Really Delete It?');">Delete</a>
</itemtemplate>
                </asp:TemplateColumn>
            </Columns>
        </cc1:datagridtable>
    </td>
  </tr>
  <tr>
  <td align="left">
  <asp:TextBox id="txtParamstr" runat="server" Visible="False" Width="48px"></asp:TextBox>
  </td>
  </tr>
  <tr>
  <td align="center">
  <asp:Label ID="lblTip" runat="server"></asp:Label>
  &nbsp;&nbsp;
  <a href="#" onclick="history.go(-1);">Return</a>
  </td>
  </tr>
</table>
    </form>
</body>
</html>